package com.foreknow.elmboot.mapper;

import com.foreknow.elmboot.po.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {
    /**
     * 登录查询
     * @param userId
     * @param password
     * @return
     */
    @Select("SELECT * FROM user WHERE userId=#{userId} AND password =#{password}")
    public User getUser(String userId,String password);


    /**
     * 注册
     * @param user
     * @return
     */
    @Insert("insert into user(userId,password,userName,userSex,userImg,delTag) values(#{userId},#{password},#{userName},#{userSex},#{userImg},1)")
    public int insertUser(User user);
}
